/*
 * Tank.hpp
 *
 *  Created on: 06.10.2013
 *      Author: dima
 */

#ifndef VIEW_TANK_HPP_
#define VIEW_TANK_HPP_


#include "../Model/TankModel.hpp"

#include "../Resources/IMGSplitter.hpp"

#include <SDL/SDL.h>


namespace Tanks
{

namespace View
{

  class TankView
  {
  public:

    TankView(Tanks::Model::TankModel * argTankModel,
             SDL_Surface * argScreen);

    ~TankView();

    void Draw();

  private:

    void DrawMissiles();

    void DrawTankExplosion();

    void PlaySounds();

    Tanks::Model::TankModel * m_tankModel;

    SDL_Surface * m_screen;
    SDL_Surface * m_tankImage;
    SDL_Surface * m_tankExplosionImage;

    // A part of the image is transparent background, offset indicates
    // where background ends and the actual picture begins
    int m_XOffsetTank, m_YOffsetTank;

    int m_currentImg, m_currentExplosionImg;

    int m_shootSoundChannel,
        m_driveSoundChannel,
        m_idleSoundChannel,
        m_tankExplosionSoundChannel;
  };

}

}


#endif /* VIEW_TANK_HPP_ */
